;----- In this project the conventions that have been adopted are:
;
; Global variables are predefined with a "g" i.e gintMAX
; All variables within GLPRO are varients (i.e. integers can be treated as numbers and vice versa)
; To explore the functionality of any of the commands that you see in the project (By default in dark blue)
; place the cursor on them and press F1 to launch the GLPRO help file at the command in question.
;------Set the working environment
; windowSTYLE sets the style for the main window i.e. double border, minimize buttons etc.
; try:
;windowSTYLE popup dlgframe
;windowSTYLE minimize maximize sysmenu
windowSTYLE popup
; winbackground sets the background windows for the GLPRO application
; if this line is commented out then the main screen will appear
windowBACKGROUND black
; Wintitle defines the caption to appear in the task list for the application
windowTITLE "GLPRO Demonstration Project"
; The video command sets the screen size for the application and the color depth
; for example the line below creates a 640x480 pixel window in 8-bit (256 color) resolution
windowSIZE 640 480 8
; the palette command sets the palette for the application window
palette back
; The merge command joins another file to the current script. This file typically contains frequently
; used procedures
scriptMERGE common.GLs
; --- Hotspotlayer, AbortAnim,and AscynTigger are some of GLPROs environment variables
; check out the help file by placing your cursor on a command and pressing "F1"
Set layerHOTSPOT on
Set animABORT on
Set whenBACKGROUND Off
;-- this is setting "gintCurrentSection" as a global variable with the value "0"
Global gintCurrentSection 0
;-----Set the cursor to be used in the application
mouseCURSOR arrow
;----- Mouse hotcursor defines how the cursor will look when over an active (i.e. HOT) area of the screen
mouseCUSTOMHOT hd 3 6 hdmsk
;-----Show the main background image "Back" with a fade "vwipeout" check-out fades in the help file
; for others.
imageFADE vwipeout Back
;-----load the introduction animation (title.dff) into the variable anmTitle
animLOAD title.GLa anmTitle
;---- play the animation (speed 5)
animPLAY anmTitle 5
;---- free the animation
animFREE anmTitle
;---- cgetbuf grabs an area of the screen as defined by the coordinates below the image
; is placed into the variable "menu_button_buffer" this can then be displayed using putup, cfade, cfadexy etc
imageGETCLIP menu_button_buffer 18,60,157,286
;-- winfontstyle sets the style to be used on creating a font within GLPRO from a TTF in Windows
; in this case we "init" intialise the style to get rid of any previously set in GLPRO
; "bold" "italic" are self explanitory and "anti" means the font will antialias to the background image
fontSTYLE init bold italic anti
; the font is chosen as "Arial" size 22 and stored in the variable head_fnt
fontDEFINE head_fnt "Arial" 16
;--- the current font is set to be the newly created font "head_fnt"
font head_fnt
;- the current foreground color is set to white and background color to black
; we need a background color as we are going to put a drop shadow on the text
color white black
; fstyle sets the pitch and offset of the drop shadow
fontSHADOW 8 2 2
; the window command defines a region of the main screen to draw into
; this means that the only part of the screen that will be updated while
; a "window" is defined inside this region
drawREGION 216,120,585,408
; "set left on" will set any text drawn to the screen as left justified
; the other two style are "right" and "center"
set textLEFT on
; text command draws text to the screen "@crlf" adds a hard return to the end of the line
; the "$" is used to join to variables/strings
text "Using this project:"$@crlf
; @texty is a GLPRO variable that holds the current y-screen coordinated of where the text will
; draw next "local y" is setting a local variable y equal to the "@texty" value
local y @textPOSy
; just using "window" by itself resets the "window" area to the entire screen
drawREGION
; free the font "head_fnt" ffree is specific to fonts i.e. fontFREE
; you can use wild cards in free any object i.e. ffree "head*" would free all font variable that started with "head"
fontFREE head_fnt
; define and set another font as above
fontSTYLE init bold anti
fontDEFINE body_fnt "Arial" 14
font body_fnt
;fgaps changes the leading, kerning and tracking of the currently set font i.e. "body_fnt"
fontGAPS , , ,-3 ;- The first to values are missed and the third is used to reduce the line spacing
;define another screen area using the "y" value previously stored
drawREGION 226,@y+10,585,408
; the "1" at the end of the text line means that it is drawn with delay 1
text "This sample project has been created to demonstrate the flexability and power of GLPRO."@crlf
text @crlf
text "The code is fully commented so feel free to explore by changing values and experimenting with different commands. You are safe in the knowledge that if things go really bad then you only have to re-install this sample project and start again."
text @crlf@crlf
text "Clicking on any ^yellow^GLPRO command^white^ or ^yellow^system variable^white^ and pressing the "$@quote$"F1"$@quote$" key for help will give you a complete definition of the command and specific examples of how it can be used."
text @crlf@crlf
text "The help file also gives you lots of general examples of different ways in which the large range of commands and system variables can be used."
drawREGION
;-----Setup the menu by calling a common sub-routine "CreateMenuHotspots" this is contained
; in the COMMON.TXT script as we will be needing it in other scripts/sections of the program